-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sanitize text before making repr_html #3378
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good thinking to sanitize the inputs for stray html. I think we could simplify the approach and I've made comments to that effect below. Again we're also missing tests for these changes. It would be good to see a test for every string element that gets added to the html repr confirming that stray html is being sanitized.
So it looks like the html module was added to python in version 3.2 so this is not compatible with 2.7. That said, the escape function isn't that complicated as it just involves a couple of string replace operations (In the form i'm using, it could be written in about 5 lines). |
👍 Support this decision (with the expectation that it will be reversed once Iris goes Python 3+ only!) |
@stephenworsley I've moved this PR back into to the "In progress" column as it looks like this is still requiring tests |
# Conflicts: # lib/iris/experimental/representation.py # lib/iris/tests/stock/__init__.py
@stephenworsley @lbdreyer Is this PR making the cut for If so, it needs a bit of ❤️ and should now target the Otherwise, let's target |
I think it's a bit too late, unfortunately. And I'm a little unsure about the approach. |
c20036f
to
0967c12
Compare
0967c12
to
3d185a5
Compare
Hi @stephenworsley However, I unfortunately found that none of the tests in So if you examine the Travis log + search for "representation", it is running Naturally, this means they do not pass 🤕 . |
Re: stephenworsley#5 OWOK, I think 👍 |
Addresses #3377. May be relevant to #3313.
All text which is taken from a cube and put into its repr_html is now passed through
html.escape()
first.